package us.icitap.cm.ui.policecase;

import java.util.List;

import us.icitap.cm.business.AppListManadatoryValuesEnum;
import us.icitap.cm.business.entities.AppEntity;
import us.icitap.cm.business.entities.CaseOfficer;
import us.icitap.cm.business.entities.Control;
import us.icitap.cm.business.entities.ControlAppEntityFound;
import us.icitap.cm.business.entities.Document;
import us.icitap.cm.business.entities.Drug;
import us.icitap.cm.business.entities.EntityEntityAssociation;
import us.icitap.cm.business.entities.EntityTypeEnum;
import us.icitap.cm.business.entities.EventReport;
import us.icitap.cm.business.entities.Evidence;
import us.icitap.cm.business.entities.Experiment;
import us.icitap.cm.business.entities.Expertise;
import us.icitap.cm.business.entities.Item;
import us.icitap.cm.business.entities.Organization;
import us.icitap.cm.business.entities.Person;
import us.icitap.cm.business.entities.Place;
import us.icitap.cm.business.entities.Report;
import us.icitap.cm.business.entities.ReportTypeEnum;
import us.icitap.cm.business.entities.SupplementReport;
import us.icitap.cm.business.entities.Vehicle;
import us.icitap.cm.business.entities.Weapon;
import us.icitap.cm.utils.UIUtils;
import us.icitap.utils.FormatingUtils;

import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;

public class ViewCaseLayout extends VerticalLayout{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5050543613802205903L;


	public static VerticalLayout showEventReport(Report report){
		VerticalLayout erVl = new VerticalLayout();
		erVl.setMargin(true);
		erVl.setWidth("650px");
		
	
		VerticalLayout v = ViewCaseLayout.showER(report);
	
		erVl.addComponent(v);
		

		VerticalLayout sectionVl = ViewCaseLayout.getSection("Informacion mbi personat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> personList = report.getAppEntityByType(EntityTypeEnum.PERSON);
		if(personList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi personat te rregjistruar"));
		for (AppEntity appEntity : personList) {
			sectionVl.addComponent(ViewCaseLayout.showPerson(appEntity.getPerson()));	
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi dokumentat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> docList = report.getAppEntityByType(EntityTypeEnum.DOCUMENT);
		if(docList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi dokumentat te rregjistruar"));
		for (AppEntity appEntity : docList) {
			sectionVl.addComponent(ViewCaseLayout.showDocument(appEntity.getDocument()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi automjetet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> vList = report.getAppEntityByType(EntityTypeEnum.VEHICLE);
		if(vList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi automjetet te rregjistruar"));
		for (AppEntity appEntity : vList) {
			sectionVl.addComponent(ViewCaseLayout.showVehicle(appEntity.getVehicle()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi drogat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> dList = report.getAppEntityByType(EntityTypeEnum.DRUG);
		if(dList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi drogat/narkotiket te rregjistruar"));
		for (AppEntity appEntity : dList) {
			sectionVl.addComponent(ViewCaseLayout.showDrug(appEntity.getDrug()));
			
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi armet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> wList = report.getAppEntityByType(EntityTypeEnum.WEAPON);
		if(wList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi armet te rregjistruar"));
		for (AppEntity appEntity : wList) {
			sectionVl.addComponent(ViewCaseLayout.showWeapon(appEntity.getWeapon()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi sendet/objektet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> iList = report.getAppEntityByType(EntityTypeEnum.ITEM);
		if(iList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi sendet te rregjistruar"));
		for (AppEntity appEntity : iList) {
			sectionVl.addComponent(ViewCaseLayout.showItem(appEntity.getItem()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi organizatat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> oList = report.getAppEntityByType(EntityTypeEnum.ORGANIZATION);
		if(oList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi organizatat te rregjistruar"));
		for (AppEntity appEntity : oList) {
			sectionVl.addComponent(ViewCaseLayout.showOrganization(appEntity.getOrganization()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi adresat/vendndodhjet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> placeList = report.getAppEntityByType(EntityTypeEnum.PLACE);
		if(placeList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi vendet te rregjistruar"));
		for (AppEntity appEntity : placeList) {
			sectionVl.addComponent(ViewCaseLayout.showPlace(appEntity.getPlace()));	
		}
		
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi kontrollet");
		erVl.addComponent(sectionVl);
		
		List<Control> controlList = report.getControlList();
		if(controlList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion te rregjistruar mbi kontrollet"));
		for (Control control : controlList) {
			sectionVl.addComponent(ViewCaseLayout.showControl(control));	
		}
		
		
		VerticalLayout notesVl = new VerticalLayout();
		notesVl.setCaption("Shenime");
		notesVl.setMargin(false);
		notesVl.addStyleName("underlined");
		
		notesVl.addComponent(ViewCaseLayout.getValue(report.getNotes()));
		
		erVl.addComponent(notesVl);
		
				
		return erVl;
		
	}
	
	public static VerticalLayout showSupplementReport(Report report){
		VerticalLayout erVl = new VerticalLayout();
		erVl.setMargin(true);
		erVl.setWidth("650px");
		
		VerticalLayout v = ViewCaseLayout.showSR(report);
		
		erVl.addComponent(v);
		
		
		VerticalLayout sectionVl = ViewCaseLayout.getSection("Informacion mbi personat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> personList = report.getAppEntityByType(EntityTypeEnum.PERSON);
		if(personList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi personat te rregjistruar"));
		for (AppEntity appEntity : personList) {
			sectionVl.addComponent(ViewCaseLayout.showPerson(appEntity.getPerson()));	
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi dokumentat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> docList = report.getAppEntityByType(EntityTypeEnum.DOCUMENT);
		if(docList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi dokumentat te rregjistruar"));
		for (AppEntity appEntity : docList) {
			sectionVl.addComponent(ViewCaseLayout.showDocument(appEntity.getDocument()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi automjetet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> vList = report.getAppEntityByType(EntityTypeEnum.VEHICLE);
		if(vList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi automjetet te rregjistruar"));
		for (AppEntity appEntity : vList) {
			sectionVl.addComponent(ViewCaseLayout.showVehicle(appEntity.getVehicle()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi drogat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> dList = report.getAppEntityByType(EntityTypeEnum.DRUG);
		if(dList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi drogat/narkotiket te rregjistruar"));
		for (AppEntity appEntity : dList) {
			sectionVl.addComponent(ViewCaseLayout.showDrug(appEntity.getDrug()));
			
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi armet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> wList = report.getAppEntityByType(EntityTypeEnum.WEAPON);
		if(wList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi armet te rregjistruar"));
		for (AppEntity appEntity : wList) {
			sectionVl.addComponent(ViewCaseLayout.showWeapon(appEntity.getWeapon()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi sendet/objektet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> iList = report.getAppEntityByType(EntityTypeEnum.ITEM);
		if(iList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi sendet te rregjistruar"));
		for (AppEntity appEntity : iList) {
			sectionVl.addComponent(ViewCaseLayout.showItem(appEntity.getItem()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi organizatat");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> oList = report.getAppEntityByType(EntityTypeEnum.ORGANIZATION);
		if(oList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi organizatat te rregjistruar"));
		for (AppEntity appEntity : oList) {
			sectionVl.addComponent(ViewCaseLayout.showOrganization(appEntity.getOrganization()));
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi adresat/vendndodhjet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> placeList = report.getAppEntityByType(EntityTypeEnum.PLACE);
		if(placeList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion mbi vendet te rregjistruar"));
		for (AppEntity appEntity : placeList) {
			sectionVl.addComponent(ViewCaseLayout.showPlace(appEntity.getPlace()));	
		}
		
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi kontrollet");
		erVl.addComponent(sectionVl);
		
		List<Control> controlList = report.getControlList();
		if(controlList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion te rregjistruar mbi kontrollet"));
		for (Control control : controlList) {
			sectionVl.addComponent(ViewCaseLayout.showControl(control));	
		}
		
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi aktet e ekspertizes");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> expertiseList =  report.getAppEntityByType(EntityTypeEnum.EXPERTISE);
		if(expertiseList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion te rregjistruar mbi aktet e ekspertizes"));
		for (AppEntity appEntity : expertiseList) {
			sectionVl.addComponent(ViewCaseLayout.showExpertise(appEntity.getExpertise()));	
		}
		
		sectionVl = ViewCaseLayout.getSection("Informacion mbi eksperimentet");
		erVl.addComponent(sectionVl);
		
		List<AppEntity> experimentList =  report.getAppEntityByType(EntityTypeEnum.EXPERIMENT);
		if(experimentList.isEmpty()) sectionVl.addComponent(ViewCaseLayout.getLabel("Nuk ka asnje informacion te rregjistruar mbi eksperimentet"));
		for (AppEntity appEntity : experimentList) {
			sectionVl.addComponent(ViewCaseLayout.showExperiment(appEntity.getExperiment()));	
		}
		
		
		
		return erVl;
		
	}

	private static VerticalLayout showEvidence(Evidence evidence){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setCaption(evidence.toFullString());
		
		GridLayout gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Nr. i proves (sipas listes se inventarit)"));
		gl.addComponent(ViewCaseLayout.getValue(evidence.getEvidenceNo()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Data e marrjes/gjetjes"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDate(evidence.getEvidenceDate())));
		
		
		gl.addComponent(ViewCaseLayout.getLabel("Lloji i proves"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(evidence.getEvidenceType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Menyra e gjetjes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(evidence.getEvidenceIdentMethod())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(evidence.getNotes()));
		
		vl.addComponent(gl);
		return vl;
	}
	private static VerticalLayout getAssociations(AppEntity appEntity){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(true);
		vl.setCaption("Lidhjet me entitetet e tjera");
		
		if(appEntity.getEntityAssocAsOneList() != null && !appEntity.getEntityAssocAsOneList().isEmpty()) {
			
			for (EntityEntityAssociation eea : appEntity.getEntityAssocAsOneList()) {
				Label l = new Label();
				l.setValue(appEntity.toFullString() 
						+ " <<"+ eea.getAssociationType().getTag() +">> " 
						+ eea.getEntityTwo().toFullString());
				
				vl.addComponent(l);
				
			}
			
		}
		if(appEntity.getEntityAssocAsTwoList() != null && !appEntity.getEntityAssocAsTwoList().isEmpty()) {
			
			for (EntityEntityAssociation eea : appEntity.getEntityAssocAsTwoList()) {
				Label l = new Label();
				l.setValue("["+ eea.getEntityOne().toFullString()
						+ " <<"+ eea.getAssociationType().getTag() +">> " 
						+ appEntity.toFullString());
				
				vl.addComponent(l);
				
			}
			
		}

		return vl;
	}
	
	private static VerticalLayout getContainerLayout(Component c, String caption){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
//		vl.addStyleName("cmBorder");
		vl.setCaption(caption);
		vl.addComponent(c);
		return vl;
	}
	private static GridLayout getGridLayout(int cols, int rows){
		GridLayout g = new GridLayout(cols,rows);
		g.addStyleName("gray");
	
		g.setColumnExpandRatio(0, 3);
		g.setColumnExpandRatio(1, 5);
		if(cols == 3)
			g.setColumnExpandRatio(2, 5);
		g.setSpacing(true);
		g.setMargin(true);
		g.setSizeFull();
		return g;
	}
	
	private static GridLayout getGridLayout(int cols){
		GridLayout g = new GridLayout();
		g.setColumns(cols);
		g.addStyleName("gray");
	
		g.setColumnExpandRatio(0, 3);
		g.setColumnExpandRatio(1, 5);
		if(cols == 3)
			g.setColumnExpandRatio(2, 5);
		g.setSpacing(true);
		g.setMargin(true);
		g.setSizeFull();
		return g;
	}
	
	private static Label getTitle(String title){
		Label l = new Label(title);
		l.setWidth("600px");
		l.addStyleName("titleLabel");
		return l;
	}
	
	private static VerticalLayout getSection(String caption){
		VerticalLayout vl = new VerticalLayout();
		vl.setCaption(caption);
		vl.addStyleName("underlined");
		vl.setMargin(true);
		return vl;
		
	}
	private static Label getSubTitle(String title){
		Label l = new Label(title);
		l.setWidth("500px");
		l.addStyleName("subtitleLabel");
		l.setSizeFull();
		return l;
	}
	public static Label getLabel(String label){
		Label l = new Label(label);

		return l;
	}
	
	public static Label getValue(String value){
		Label l = new Label((value !=null? value : "-"));
		l.addStyleName("valueLabel");
		return l;
	}
	
	public static Label getValue(String value, String caption){
		Label l = new Label((value !=null? value : "-"));
		l.setCaption(caption);
		l.addStyleName("valueLabel");
		return l;
	}
	
	
	public static VerticalLayout showER(Report report){
		VerticalLayout vl = new VerticalLayout();
		vl.setCaption(ReportTypeEnum.ER.getCaption());
		vl.addStyleName("underlined");
		vl.setMargin(false);
		
		EventReport er = report.getEventReport();
		
		GridLayout gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Numri unik"));
		gl.addComponent(ViewCaseLayout.getValue(er.getUniqueNumber() != null ? er.getUniqueNumber().getUniqueNumber() : "-"));
		
		gl.addComponent(ViewCaseLayout.getLabel("Menyra e raportimit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(er.getReportingMethod())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Data,Ora e ngjarjes"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(er.getEventTimeFrom()) + " - " + FormatingUtils.formatedDateTime(er.getEventTimeTo())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Kodi policor"));
		gl.addComponent(ViewCaseLayout.getValue(er.getReport().getPoliceCodeList().toString()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Dhune ne familje"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(er.isDomesticViolence())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Mbetur ne tentative"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(er.isRemainedAttempt())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Motivi/Arsyeja"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(er.getMotivation())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Modus Operandus"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(er.getModusOperandus())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Mjetet e perdorura"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(er.getToolUsedList())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Pasojat"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(er.getConsequenceList())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Fillimi i hetimit"));
		if(report.getInvestStartedMethod() != null)
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getInvestStartedMethod())));
		else
			gl.addComponent(ViewCaseLayout.getValue(report.getInvestStartedDescription()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Metoda e hetimit"));
		if(report.getInvestigationMethod() != null)
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getInvestigationMethod())));
		else
			gl.addComponent(ViewCaseLayout.getValue(report.getInvestMethodDescription()));
		
		if(report.getPoliceOperation() != null){
			gl.addComponent(ViewCaseLayout.getLabel("Realizuar me operacion policor"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getPoliceOperation().getOperationType())));
			
			if(report.getPoliceOperation().getStatesList() != null && !report.getPoliceOperation().getStatesList().isEmpty()){
				gl.addComponent(ViewCaseLayout.getLabel("Ne bashkpunim me"));
				gl.addComponent(ViewCaseLayout.getValue(report.getPoliceOperation().getStatesList().toString()));
			}
		}
		
		gl.addComponent(ViewCaseLayout.getLabel("Oficeri qe ploteson raportin"));
		gl.addComponent(ViewCaseLayout.getValue(report.getReportOfficer().getPoliceId() + ", " + report.getReportOfficer().getNameSurname()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Struktura organizative"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getOrgStructure())));
		
		
		vl.addComponent(gl);

		if(er.getPlace() != null){
			VerticalLayout pVl = ViewCaseLayout.showPlace(er.getPlace());
			vl.addComponent(pVl);
		}
		
		
		
		
		return vl;
	}
	
	public static VerticalLayout showSR(Report report){
		VerticalLayout vl = new VerticalLayout();
		vl.setCaption(ReportTypeEnum.SR.getCaption());
		vl.addStyleName("underlined");
		vl.setMargin(false);
		
		SupplementReport sr = report.getSupplementReport();
		
		GridLayout gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Numri unik"));
		gl.addComponent(ViewCaseLayout.getValue(sr.getSrUniqueNumber()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Data,Ora e plotesimit te raportit"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(report.getReportDate())));
		
		
		
		gl.addComponent(ViewCaseLayout.getLabel("Kodi policor"));
		gl.addComponent(ViewCaseLayout.getValue(sr.getReport().getPoliceCodeList().toString()));

		
		gl.addComponent(ViewCaseLayout.getLabel("Fillimi i hetimit"));
		if(report.getInvestStartedMethod() != null)
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getInvestStartedMethod())));
		else
			gl.addComponent(ViewCaseLayout.getValue(report.getInvestStartedDescription()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Metoda e hetimit"));
		if(report.getInvestigationMethod() != null)
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getInvestigationMethod())));
		else
			gl.addComponent(ViewCaseLayout.getValue(report.getInvestMethodDescription()));
		
		if(report.getPoliceOperation() != null){
			gl.addComponent(ViewCaseLayout.getLabel("Realizuar me operacion policor"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getPoliceOperation().getOperationType())));
			
			if(report.getPoliceOperation().getStatesList() != null && !report.getPoliceOperation().getStatesList().isEmpty()){
				gl.addComponent(ViewCaseLayout.getLabel("Ne bashkpunim me"));
				gl.addComponent(ViewCaseLayout.getValue(report.getPoliceOperation().getStatesList().toString()));
			}
		}
		
		gl.addComponent(ViewCaseLayout.getLabel("Oficeri qe ploteson raportin"));
		gl.addComponent(ViewCaseLayout.getValue(report.getReportOfficer().getPoliceId() + ", " + report.getReportOfficer().getNameSurname()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Struktura organizative"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(report.getOrgStructure())));
		
		vl.addComponent(gl);

		return vl;
	}
	
	public static VerticalLayout showPlace(Place p){
		VerticalLayout vl = new VerticalLayout();
		vl.setCaption(EntityTypeEnum.PLACE.getCaption());
		vl.setMargin(false);
		vl.addStyleName("underlined");
		GridLayout gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Klasifikimi  i objektit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getPlaceClassification())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Tipi  i objektit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getPlaceType())));
		
		
		gl.addComponent(ViewCaseLayout.getLabel("Rruga, Nr, Apartamenti"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getStreet()) + ", " + p.getNumber() + ", " + p.getApartment()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shteti, Qyteti"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getStates()) + ", " + UIUtils.textConverter(p.getCities())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Qarku, Rrethi"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getRegion()) + ", " + UIUtils.textConverter(p.getCities())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(p.getAddressText()));
		
		vl.addComponent(gl);

		vl.addComponent(ViewCaseLayout.getAssociations(p.getAppEntity()));
		
		return vl;
		
	}
	
	public static VerticalLayout showPerson(Person p){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption("Person: " + p.getName() + " " + p.getSurname());
		
		GridLayout gl;
		if(p.getInvolvement().toString().equals(AppListManadatoryValuesEnum.PersonInvolvement_SUSPECT.toString())){
			gl = ViewCaseLayout.getGridLayout(2);
			
			gl.addComponent(ViewCaseLayout.getLabel("Perfshirja"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getInvolvement())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Emer, Mbiemer"));
			gl.addComponent(ViewCaseLayout.getValue(p.getName() + " " + p.getSurname()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Emer Babai, Nene"));
			gl.addComponent(ViewCaseLayout.getValue(p.getFatherName() + " " + p.getMotherName()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Seksi"));
			gl.addComponent(ViewCaseLayout.getValue(p.getSex() != null ? p.getSex().name() : "-"));
			
			gl.addComponent(ViewCaseLayout.getLabel("Datelindje"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDate(p.getBirthDate())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Mosha (vjec)"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getAge())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Kombesia"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getNationality())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Edukimi"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getEducation())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Profesioni"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getProfession())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Cilesi e vecante"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getSpecialQuality())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Nofkat"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getAliasList())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Gjatesia (cm)"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getHeight())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Pesha (kg)"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getWeight())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ngjyra e syve"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getEyeColor())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ngjyra e flokeve"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getHairColor())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Perkatesia etnike"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getHumanRace())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Gjendja fizike"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getPhysicalPsychicStatus())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ndikimi nga alkoli"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(p.isAlcoholInfluence())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ndikimi nga alkoli mbi limitin e lejuar"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(p.isAlcoInflOverLimit())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ndikimi nga droga"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(p.isDrugsInfluence())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Ndikime te tjera"));
			gl.addComponent(ViewCaseLayout.getValue(p.getOtherInfluence()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Statusi i personit"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getPersonStatus())));
		}
		else{
			
			gl = ViewCaseLayout.getGridLayout(2);
			
			gl.addComponent(ViewCaseLayout.getLabel("Perfshirja"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getInvolvement())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Emer, Mbiemer"));
			gl.addComponent(ViewCaseLayout.getValue(p.getName() + " " + p.getSurname()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Emer Babai, Nene"));
			gl.addComponent(ViewCaseLayout.getValue(p.getFatherName() + " " + p.getMotherName()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Seksi"));
			gl.addComponent(ViewCaseLayout.getValue(p.getSex() != null ? p.getSex().name() : "-"));
			
			gl.addComponent(ViewCaseLayout.getLabel("Datelindje"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDate(p.getBirthDate())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Mosha (vjec)"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getAge())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Kombesia"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getNationality())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Edukimi"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getEducation())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Profesioni"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getProfession())));
			
			gl.addComponent(ViewCaseLayout.getLabel("Cilesi e vecante"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(p.getSpecialQuality())));
			
			
		}

		vl.addComponent(gl);
		vl.addComponent(ViewCaseLayout.getAssociations(p.getAppEntity()));

		return vl;
	}
	
	public static VerticalLayout showDocument(Document d){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(d.getAppEntity().toFullString());
		GridLayout gl;
		
		gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Klasifikimi i dokumentit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDocClassfication())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Lloji i dokumentit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDocumentType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Nr. i dokumentit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDocumentNo())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shteti i leshimit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getStates())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Data e leshimit"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDate(d.getDateIssued())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Data e skadimit"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDate(d.getExpDate())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getNotes())));
		
		vl.addComponent(gl);
		
		if(d.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(d.getAppEntity().getEvidence()));
		}
		
		vl.addComponent(ViewCaseLayout.getAssociations(d.getAppEntity()));
	
		return vl;
	}
	
	
	public static VerticalLayout showVehicle(Vehicle v){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(v.getAppEntity().toFullString());
	
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Tipi i makines"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getVehicleType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Marka"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getVehicleBrand())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Modeli"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getVehicleModel())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Ngjyra"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getColor())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Viti i prodhimit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getProductionYear())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Nr. Shasise"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getVin())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Targa"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getPlateId())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Detaje"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getDetails())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Gjendja aktuale"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(v.getActualSituation())));
		
		gl.addComponent(ViewCaseLayout.getLabel("E regjistruar"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(v.isRegistered())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Me kontroll teknik"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(v.isTechnicalTested())));
		
		gl.addComponent(ViewCaseLayout.getLabel("E siguruar"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(v.isInsured())));
		
		vl.addComponent(gl);
		
		if(v.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(v.getAppEntity().getEvidence()));
		}
		
		vl.addComponent(ViewCaseLayout.getAssociations(v.getAppEntity()));
		
		return vl;
		
	}
	
	public static VerticalLayout showDrug(Drug d){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(d.getAppEntity().toFullString());
	
		GridLayout gl;
		
		gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Klasifikimi i droges"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDrugClassification())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Tipi i droges"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDrugType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Sasia"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getQuantity()) + (d.getUnit()!= null?d.getUnit().name():"")));
		
		gl.addComponent(ViewCaseLayout.getLabel("Vendi i origjines"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getOriginCountry())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Destinacioni"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getDestinationCountry())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Vendi transit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getTransitCountry())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(d.getNotes())));
		
		vl.addComponent(gl);
		
		if(d.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(d.getAppEntity().getEvidence()));
		}
		
		
		vl.addComponent(ViewCaseLayout.getAssociations(d.getAppEntity()));
		
		
		return vl;
		
		
	}
	
	
	public static VerticalLayout showWeapon(Weapon w){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(w.getAppEntity().toFullString());
	
		GridLayout gl;
		
		gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Klasifikimi i armes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(w.getClassification())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Tipi i armes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(w.getWeaponType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Modeli"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(w.getWeaponModel())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Detaje te armes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(w.getNotes())));
		
		
		vl.addComponent(gl);
		
		if(w.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(w.getAppEntity().getEvidence()));
		}
		
		
		vl.addComponent(ViewCaseLayout.getAssociations(w.getAppEntity()));
		return vl;
		
	}
	
	public static VerticalLayout showItem(Item i){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(i.getAppEntity().toFullString());
	
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Klasifikimi i sendit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getItemClassification())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Tipi i sendit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getItemType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Emertimi"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getName())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Pershkrimi"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getDescription())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Vlera"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getValue())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(i.getNotes())));
		
		vl.addComponent(gl);
		
		if(i.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(i.getAppEntity().getEvidence()));
		}
		
		vl.addComponent(ViewCaseLayout.getAssociations(i.getAppEntity()));
		
		return vl;
	}
	
	public static VerticalLayout showOrganization(Organization o){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(o.getAppEntity().toFullString());
	
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		gl.addComponent(ViewCaseLayout.getLabel("Tipi i organizates"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(o.getOrganizationType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Emri"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(o.getName())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Shenime"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(o.getNotes())));
		
		vl.addComponent(gl);
		vl.addComponent(ViewCaseLayout.getAssociations(o.getAppEntity()));
		
		return vl;
	}
	
	public static VerticalLayout showOfficer(CaseOfficer o){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeUndefined();
		vl.addStyleName("underlined");
		
		return vl;
		
	}
	
	
	public static VerticalLayout showControl(Control c){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(c.getAppEntity().toFullString());
		
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Intervali kohor"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(c.getStartDate()) + " - " + FormatingUtils.formatedDateTime(c.getEndDate())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Kontrolli mbi"));
		gl.addComponent(ViewCaseLayout.getValue(c.getSubjectAppEntity().toFullString()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Me vendim gjykate"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(c.isCourtDecision())));
		
		if(c.isCourtDecision()){
			gl.addComponent(ViewCaseLayout.getLabel("Nr. vendimit"));
			gl.addComponent(ViewCaseLayout.getValue(c.getCourtDecisionNo()));
			
			gl.addComponent(ViewCaseLayout.getLabel("Data e vendimit"));
			gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(c.getCourtDecisionDate())));
		}
		
		gl.addComponent(ViewCaseLayout.getLabel("Me iniciative"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.yesNoConverter(c.isOfficerIniciative())));
		
		if(c.isOfficerIniciative()){
			gl.addComponent(ViewCaseLayout.getLabel("Qellimi i kontrollit"));
			gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(c.getControlReason())));
		}
		
		gl.addComponent(ViewCaseLayout.getLabel("Kerkesa per kontroll"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(c.getControlRequestEnum())));
		
		
		vl.addComponent(gl);
		
		VerticalLayout poVl = new VerticalLayout();
		poVl.setCaption("Personat/Objektet e gjetura gjate kontrollit");
		
		System.out.println(c.getControlAppEntityFoundList());
		
		List<AppEntity> personAppEntityList = c.getPersonEntityFoundList();
		System.out.println(personAppEntityList);
		if(personAppEntityList != null && !personAppEntityList.isEmpty()){
			for (AppEntity appEntity : personAppEntityList) {
				poVl.addComponent(ViewCaseLayout.getValue((appEntity.toFullString())));
			}
		}
		
		
		List<ControlAppEntityFound> list = c.getNonPersonEntityFoundList();
		System.out.println(list);
		if(list != null && !list.isEmpty()){
			for (ControlAppEntityFound caef : list) {
				String itemIdentification = (caef.getItemIdentificationEnum()!= null?caef.getItemIdentificationEnum().getCaption():"-");
				String itemStatus = (caef.getItemStatusEnum()!=null?caef.getItemStatusEnum().getCaption():"-");
				poVl.addComponent(ViewCaseLayout.getValue((caef.getAppEntity().toFullString() + ", " + itemIdentification + ", " + itemStatus )));
			}
		}
		
		vl.addComponent(poVl);
		
		return vl;
		
	}
	
	
	public static VerticalLayout showExpertise(Expertise ex){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(ex.getAppEntity().toFullString());
		
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Data e aktit te ekspertizes"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(ex.getExpertiseDate())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Nr. i aktit te ekspertizes"));
		gl.addComponent(ViewCaseLayout.getValue(ex.getExpertiseActNo()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Lloji i aktit te ekspertizes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(ex.getExpertiseType())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Konkluzionet e aktit te ekspertizes"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(ex.getExpertiseConclusion())));
		
		vl.addComponent(gl);
		
		if(ex.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(ex.getAppEntity().getEvidence()));
		}
		
		
		
		return vl;
	}
	
	
	public static VerticalLayout showExperiment(Experiment ex){
		VerticalLayout vl = new VerticalLayout();
		vl.setMargin(false);
		vl.setSizeFull();
		vl.addStyleName("underlined");
		vl.setCaption(ex.getAppEntity().toFullString());
		
		GridLayout gl;
		gl = ViewCaseLayout.getGridLayout(2);
		
		gl.addComponent(ViewCaseLayout.getLabel("Data e eksperimentit"));
		gl.addComponent(ViewCaseLayout.getValue(FormatingUtils.formatedDateTime(ex.getExperimentDate())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Arsyeja e eksperimentit"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(ex.getExperimentReason())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Vendi i realizimit"));
		gl.addComponent(ViewCaseLayout.getValue(ex.getPlaceDone()));
		
		gl.addComponent(ViewCaseLayout.getLabel("Veprimet ne eksperiment"));
		gl.addComponent(ViewCaseLayout.getValue(UIUtils.textConverter(ex.getExperimentAction())));
		
		gl.addComponent(ViewCaseLayout.getLabel("Rezultatet e eksperimentit"));
		gl.addComponent(ViewCaseLayout.getValue(ex.getResult()));
		
		vl.addComponent(gl);
		
		
		if(ex.getAppEntity().getEvidence() != null){
			vl.addComponent(ViewCaseLayout.showEvidence(ex.getAppEntity().getEvidence()));
		}
		
		
		return vl;
	}
	
	
}
